Publishing an Alpha Anywhere Application to the Local Webroot

Description

A step-by-step guide to configuring a publishing profile to publish your Alpha Anywhere Application locally using the Development Server.

Important Notice for Community Edition Users

This tutorial is for the full Alpha Anywhere Development Environment. Community Edition only supports publishing to Alpha Cloud.

What is Publishing?

When you "publish" an application, Alpha Anywhere packages all files, components, reports, code, security files, locally defined Active Link and DBF tables, and any Alpha Anywhere Libraries used by the application into a directory that can then be copied to the webroot and data folders for the Application Server. Grid components are compiled into binaries that have removed meta data used by the Alpha Anywhere IDE. Reports and Xbasic scripts defined in the Control Panel are compiled into a workspace library.

Once all files have been prepared, the application can be copied or deployed to the Application Server. In the case of publishing to the local webroot, files are copied to a webroot directory that is defined in the Development Server settings. Data files are typically not copied or moved when publishing to the local webroot. Alpha Anywhere also does not require defining published aliases and connection strings using a local webroot publish profile.

Prepare Your Application for Publishing

Components in Alpha Anywhere must be embedded inside an .a5w page to view them in a web browser. Aside from the Tabbed UI Component, which generates an .a5w page automatically, you will need to create an .a5w page to embed one or more components to publish and view your application. This section explains how to create an .a5w page for a Component. If your components have their own .a5w page, you can skip to the next section, Configure the Publishing Profile.

  1. The easiest way to create an .a5w page that displays a Component is to use the Save Page tool in the Component Builder.

    Open the Component you wish to view after publishing for editing by double-clicking on the file name in the Web Projects Control Panel. This will open the Component Builder.

  2. Click the Save Page button in the Component Builder toolbar. The Save Page tool will generate an .a5w page and embed the Component on the page.

    images/savePage1.png
    The Component Builder toolbar
  3. The Save Page dialog presents several options for creating the .a5w page. You can choose to style the page background separately from the Component's style settings. You can also optionally open the HTML editor to edit the .a5w page. The HTML editor is Alpha Anywhere's build-in editor for editing HTML and .a5w pages.

    Select Automatically inherit page background from the Component style. Leave the option to open the HTML editor unchecked and click Save Page.

    images/savePage2.png
    The Save Page dialog
  4. The dialog to save the new .a5w page will open. Enter the file name for the page in the File name field. Click Save when you are done. This will save the new .a5w page containing the Component.

    images/savePage3.png
    Saving the .a5w page that will contain the Component
  5. The new .a5w page will be saved in the same directory as the Component. Open the Web Projects Control Panel and select the A5W Pages option in the left column to filter the files shown. You should see the .a5w page you just created in this list.

    images/savePage4.png
    Viewing all the .a5w pages in the web project

Now that you have an .a5w page containing the Component, the Alpha Anywhere Application can be published. The next step is configuring a Publishing Profile for publishing the application to the local webroot.

Configure the Local Webroot Publishing Profile

The Publishing Profile describes where web application files will be published in the Application Server's webroot, either locally or on a remote server. During the publishing process, the project files for the web application are compiled and copied to the webroot for the Application Server. This section describes how to configure a project to publish an application to the local webroot on the development machine. The publishing process to deploy an application to a web server is similar for both Alpha Anywhere Application Server for IIS and Alpha Anywhere Classic Application Server.

  1. From the Web Projects Control Panel, open the Web menu and select Project Settings... to open the Web Project Profiles dialog.

    images/publishingProfile1.png
    Opening Project Settings
  2. Select the Local Webroot profile from the list of profiles listed in the left-hand column. This will display the settings for the Local Webroot publishing profile.

    images/publishingProfile2.png
    Web Project Properties
  3. All files published to the local webroot will be published in the webroot. The webroot is defined in the Alpha Anywhere Development Server settings. Every Alpha Anywhere application you create will be published to the same webroot. To make it easy to disambiguate between projects for testing purposes, you can set the Target Folder property. The Target Folder is a directory inside the webroot. It's considered best practice to name the Target Folder after your project.

    Enter a Target Folder for the Local Webroot profile.

    images/publishingProfile3.png
    Define a Target Folder for the Local Webroot publishing profile
  4. You can optionally define a default page to display after publishing your application. This can be any .a5w page in your project. Define the Default Page for the Local Webroot. Open the dropdown of pages for the Default Page property and choose a default page from the list displayed.

    images/publishingProfile4.png
    Selecting a Default Page for the Local Webroot publishing profile
  5. Click OK to save the changes you made the Local Webroot publishing profile.

    images/publishingProfile5.png
    The completed publishing profile

Now that you have configured a publishing profile, the next step is to publish your application and open it in a web browser.

Publish Your Application

Alpha Anywhere web applications are deployed using the Publish Web Project dialog. Applications can be published locally on your development machine or to a remote server. In addition to deploying your project, publishing is also a useful tool for testing your application. Testing can be done locally on the development machine or on a remote server. The following instructions explain how to publish to the local webroot on the development machine.

  1. From the Web Projects Control Panel, click Publish on the toolbar.

    images/publish1.png
  2. The Publish Web Project dialog is used to configure what is published to the destination defined by the publishing profile.

    Select the Local Webroot publishing profile from the Select profile dropdown. Select the All files in project option to publish all files in the project. Check the boxes for Publish Web Project files and Publish new or modified files only. Check the option to Launch browser after files are published. For the Page to show option, select an .a5w page that will be opened when the browser is launched.

    Click the Publish button to publish the project to the local webroot.

    images/publish2.png
    Publish Web Project settings

    You can optionally check Save these settings as your Quick Publish settings to save the setting as your Quick Publish settings. This is useful if you are making frequent changes you want to test on the local webroot or a remote test server. You can Quick Publish your project by clicking the Quick publish project link below the left column on the Web Projects Control Panel.

  3. The Files to be Published dialog displays the list of files that will be published. This dialog is for informational purposes only. While you can edit the text in the dialog, it does not change which files are published to the webroot.

    Click OK to continue.

    images/publish3.png
    List of files to be published
  4. If the destination folder does not exist, you will be prompted to create the folder. Click Yes to create the destination folder.

    images/publish4.png
    Prompt asking if you would like to create the destination webroot directory
  5. When Alpha Anywhere finishes publishing the application, it will display a message. Click OK.

    images/publish5.png
    Notification that publishing is complete
  6. Next, your default web browser will launch and open the .a5w page you selected in the Publish Web Project dialog.

    The URL for this page will contain 3 components: "localhost" followed by the port number used to communicate with the Development Server, the folder that was created in the webroot where the project was published, and the .a5w page. You can view other pages in your project by typing the file location relative to the webroot in the address bar. For example, if you have a page named "TabbedUI_Admin.a5w" in the ExampleProject directory in the webroot, you could view this page by typing the following into the address bar:

    localhost:8080/ExampleProject/TabbedUI_Admin.a5w
    images/publish6.png
    Viewing the published project in the web browser

Limitations

Full Alpha Anywhere Development Environment Only

See Also